package com.java.example.controller;

import com.java.example.model.RegisterReq;
import com.java.example.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ：mmzsblog.cn
 * @description：TODO
 * @date ：2024/4/29 22:06
 */
@RestController
public class TestController {

    @Resource
    private IUserService userService;

    @GetMapping("sendVerificationCode")
    public Boolean sendVerificationCode(@RequestParam(value = "email", required = true) String email) {
        userService.sendVerificationCode(email);
        return Boolean.TRUE;
    }

    @PostMapping("register")
    public Boolean register(RegisterReq registerReq) {
        userService.register(registerReq);
        return Boolean.TRUE;
    }

}
